package com.zhiyou100.extendsDemo;

public class Test {

    public static void main(String[] args) {

        Student stu = new Student();
        //子类可以使用父类的属性
        stu.name = "小明同学";
        stu.age = 20;
        stu.sex = "男";
        stu.sNo = "201878945";
        //子类可以使用间接父类的非私有属性
        stu.height = 180;
        stu.weight = 80;
        stu.introduction();
        stu.say();

        Teacher teacher = new Teacher();
        teacher.name = "张老师";
        teacher.age = 40;
        teacher.sex = "男";
        teacher.tYear = 15;
        teacher.introduction();

    }

}
